#include <stdio.h>
#include <string.h>

int main()
{
    // C文件操作
    FILE* fp = fopen("log.txt", "r"); 
    if(NULL == fp)
    {
        perror("fopen fail!");
        return 1;
    }

    while(1)
    {
        // 读取文件 -> fread
         char buffer[1024];
         const char* msg = "Hello";
         memset(buffer, 0, sizeof(buffer));
         int n = fread(buffer, strlen(msg), 1, fp);
         if(n > 0)
             printf("%s", buffer);
         if(feof(fp)) break;
    }
    fclose(fp);
    return 0;
}
